package com.towexin.application.system.domain;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * TODO
 * 权限表
 * @author Towexin
 * @version 1.0
 * @date 2021/4/12 18:14
 */
@Data
@TableName("t_authority")
@NoArgsConstructor
@AllArgsConstructor
public class Authority implements Serializable {
    private static final long serialVersionUID = -3624470382678863996L;

    @ApiParam(value = "权限id，只需修改时上传")
    @TableId(type = IdType.ASSIGN_UUID)
    private String id;

    @ApiParam(value = "上级权限", required = true)
    @TableField(insertStrategy = FieldStrategy.NOT_NULL)
    private String pid;

    @ApiParam(value = "权限标识", required = true)
    @TableField(insertStrategy = FieldStrategy.NOT_NULL)
    private String authorityMark;        // 权限标识

    @ApiParam(value = "权限名称", required = true)
    @TableField(insertStrategy = FieldStrategy.NOT_NULL)
    private String authorityName;       // 权限名称

    @ApiParam(value = "渲染表格使用到，不用上传，系统默认赋值true")
    @TableField(insertStrategy = FieldStrategy.NOT_NULL)
    private Boolean open;                // 是否展开

    @ApiParam(value = "是否按钮（true|false）", required = true)
    @TableField(insertStrategy = FieldStrategy.NOT_NULL)
    private Boolean btn;               // 是否按钮

    @ApiParam(value = "排序")
    @TableField
    private Integer sort;                   // 排序

    @ApiParam(value = "创建时间，系统赋值")
    @TableField(fill = FieldFill.INSERT, insertStrategy = FieldStrategy.NOT_NULL)
    private Date createdTime;

    @ApiParam(value = "更新时间，系统赋值")
    @TableField(fill = FieldFill.UPDATE)
    private Date updateTime;
}
